UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LxUWzBhow+yjqCBDaqwSHIsANDaz2daced/i7xf/ScI='
WHERE
key_id = '03e49f702ac1e74cda3f03279e6258724626cb28a1f3b07a5306efd7082a024c'
AND (
token = 'LxUWzBhow+yjqCBDaqwSHIsANDaz2daced/i7xf/ScI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)