UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'elMCbhUgnC6O7FS8+xH1zRdSDXzVm/pPxhHvjAb6ZtQ=' 
WHERE 
  key_id = '2cfbedeb68ed0b90b82790535e7e2950305486fd8748d25976a0f500b79a697d' 
  AND (
    token = 'elMCbhUgnC6O7FS8+xH1zRdSDXzVm/pPxhHvjAb6ZtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031