UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ikQU+NQBxIIihy8yw7bliRqLgEMmCjbiS2Raif2RYtI='
WHERE
key_id = '74eaa1a600f736a80ba2ca1b63687fa657e640a166793b193dc1811eba39f5fb'
AND (
token = 'ikQU+NQBxIIihy8yw7bliRqLgEMmCjbiS2Raif2RYtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)