UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yhiDdWYTNkvSa3LpqUD7z2abQEK1eAM2EL/Z8TtNPgk='
WHERE
key_id = 'f23cc974439a63ac0b3a261321f6d0a51514c23c1828e11c6ea5c5a5079cf833'
AND (
token = 'yhiDdWYTNkvSa3LpqUD7z2abQEK1eAM2EL/Z8TtNPgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)