UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2IjlW74p7qxqeY9XCko06oX3vVRmvf1di+hPlxwbbKE='
WHERE
key_id = 'a812b09cd70a026f3e8c130ec04b69911d33e783260b1e2892ee032ccc9c8c83'
AND (
token = '2IjlW74p7qxqeY9XCko06oX3vVRmvf1di+hPlxwbbKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)