UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RgKl+oc2YsGaxc1T4iuE3PbvZaEiR7MZPzi8TllsNIg=' 
WHERE 
  key_id = '624601527034a0e4671b08b82e474831447f2a1efd5c769b056f9f5fde25ddbc' 
  AND (
    token = 'RgKl+oc2YsGaxc1T4iuE3PbvZaEiR7MZPzi8TllsNIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027