UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tkG57cy0XDXXr7ASnhrPUBYCFp0v0ij9EmWzxqU7Tdk=' 
WHERE 
  key_id = '508d26ac5af8ad669492fa75a3d5ba722ca2cf859bbdb9f10b05cad601b9c8f5' 
  AND (
    token = 'tkG57cy0XDXXr7ASnhrPUBYCFp0v0ij9EmWzxqU7Tdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034