UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+StMkL0lADhKhDrPLZXJj6f9JFEGn7gucIk0t4dv5Vs='
WHERE
key_id = '7ad8508dbfc544cfdefd278c287853a86b2d5605beb95918381602e44abb68c2'
AND (
token = '+StMkL0lADhKhDrPLZXJj6f9JFEGn7gucIk0t4dv5Vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)