UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y75awt5EitBfbO6qHwOO7UVpfdWl42tN089YrEdkI2g=' 
WHERE 
  key_id = 'a9586353fdde3503fb3ddbd16350909c936d4197f33a98ea40314d78b00ee9a3' 
  AND (
    token = 'y75awt5EitBfbO6qHwOO7UVpfdWl42tN089YrEdkI2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021