UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NqCToPGU/vAe83tpppJOctF1FkGYVM9jvZWlTULHLGc=' 
WHERE 
  key_id = 'b4f0a22c40896accf8ace11eb22e29fc7e45c6c2553edc800613dc0a5bbc7eab' 
  AND (
    token = 'NqCToPGU/vAe83tpppJOctF1FkGYVM9jvZWlTULHLGc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032