UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M/1V2bG7IWDZIItkuOm1QYCln5fFGLbjG/QWQLaIGQs='
WHERE
key_id = 'f15def0793407eeb86e18f0447b0c701f226aa0bb7a08c5b4c91bf0f1e75a295'
AND (
token = 'M/1V2bG7IWDZIItkuOm1QYCln5fFGLbjG/QWQLaIGQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)