UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C/LZ9QwwvyrtXSky5R9/Io4jaBAPBVi1altEniQX8Ks='
WHERE
key_id = '1a514898537a7b559a82fb5cd65711b356a31691fe6c5eb27f1c3173ac5b47ef'
AND (
token = 'C/LZ9QwwvyrtXSky5R9/Io4jaBAPBVi1altEniQX8Ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)