UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fxhJHFmf4WNTbzQxLkawhs9heZu/rKa8DpfLGGhLD28=' 
WHERE 
  key_id = '2adff1d01d40d55fbd1d3c6fe057bc79ca37f1eb6625eea35e07f3f3fa07fecf' 
  AND (
    token = 'fxhJHFmf4WNTbzQxLkawhs9heZu/rKa8DpfLGGhLD28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024