UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UTTJUWP34SqZufdIJ+WiNQ2mLwOKbE0j3EbNH0guwEA=' 
WHERE 
  key_id = '5fbd41cb521c085a882af87d416e46c78aee81a0c3ed3d804b88ffc607a364b9' 
  AND (
    token = 'UTTJUWP34SqZufdIJ+WiNQ2mLwOKbE0j3EbNH0guwEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033