UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oQGkh3uxaOh2GXHBVAUfitsuFQBbAbOxMg/9vXEXWNA='
WHERE
key_id = '6d3ad32ce28ddf9ad1f61222d139a6b6fc69804f717c456e2d21466bd21028e5'
AND (
token = 'oQGkh3uxaOh2GXHBVAUfitsuFQBbAbOxMg/9vXEXWNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)