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