UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zEas3uKM2kHVxtG33rfKNNeMaRQk15HJypT4+0jccQg='
WHERE
key_id = '484ccb701186d867e0c210eb74a069d75dd4c5715422cdb6c6aa6be798fa97ea'
AND (
token = 'zEas3uKM2kHVxtG33rfKNNeMaRQk15HJypT4+0jccQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)