UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3XsGSaTZ3Mx3hPn6CQBQ9J1/ajBCGrh+TpVEXPjknoI=' 
WHERE 
  key_id = '3df541818a0bd44ec0964fb197f13c0980dba80b7568502488b76c76a092149d' 
  AND (
    token = '3XsGSaTZ3Mx3hPn6CQBQ9J1/ajBCGrh+TpVEXPjknoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019