UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZCCQl9na75gFxKQduXShZn8eVTrMgHPy23GEJ0LNTo='
WHERE
key_id = '5ea4ce845c2b10cfe292d4daedd3aad9a222d0b4638a1cdfe7ce540982bf06da'
AND (
token = 'WZCCQl9na75gFxKQduXShZn8eVTrMgHPy23GEJ0LNTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)