UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p2kGrxP1q53PgDMbwesiKDeU1/MO3wSfYYIKKkN/wmo='
WHERE
key_id = 'b71e7ec7812730c9c6d7653aa0e65b9f20275972cad63ff250d732ebaa99ee8d'
AND (
token = 'p2kGrxP1q53PgDMbwesiKDeU1/MO3wSfYYIKKkN/wmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)