UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T/XwSWIJQl6v1O5Vord+DQeiO+U6cLR6iQHOMJzNXkM=' 
WHERE 
  key_id = 'c9229e224b6b6c661f0b25f063b8571464236de75df11c266b4a98bf64902acb' 
  AND (
    token = 'T/XwSWIJQl6v1O5Vord+DQeiO+U6cLR6iQHOMJzNXkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029