UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '84k5Y5LJ35ZbHjmtYXmDfFWQc2WIOvnOJXDVqG4df1o='
WHERE
key_id = '8fe8042f9d52703250f71145fd5d798359eca2d2a83545ce047838f5dddf906a'
AND (
token = '84k5Y5LJ35ZbHjmtYXmDfFWQc2WIOvnOJXDVqG4df1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)