UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x0su/EjmKbzhtNV+UA9has74XOQ8WuWRxXNEj3IZU9w='
WHERE
key_id = '185e466200eae153378a0773c11bd5881bb3ad5ab0e7c7abf58dbd7cfd3584ac'
AND (
token = 'x0su/EjmKbzhtNV+UA9has74XOQ8WuWRxXNEj3IZU9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)