UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cM2v4OhneKAQV6AntR6Fz4dp6xfm0obR1l5GX708fDY='
WHERE
key_id = '18f23185301eff05bb5f6a0a414ee8c1f5ccc5e83b42f150bc6cac2629322be2'
AND (
token = 'cM2v4OhneKAQV6AntR6Fz4dp6xfm0obR1l5GX708fDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)