UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ROuY+M98KHz7VH5tTtsoyONA1L/DJA+Ghr+N0tzq/Kc='
WHERE
key_id = 'e003e44a8d5c572befe7f3bd50921e903a8877c2eb733212aad604ace1053afc'
AND (
token = 'ROuY+M98KHz7VH5tTtsoyONA1L/DJA+Ghr+N0tzq/Kc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)