UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fZaEYKR1lHTxqkELLbIyXOQl0DSlRsPKeB6scqdfSLY=' 
WHERE 
  key_id = 'b8fb68538e914b227b6c6ae6699ba85d6f256285890cb548ddbc757fd0cb6209' 
  AND (
    token = 'fZaEYKR1lHTxqkELLbIyXOQl0DSlRsPKeB6scqdfSLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036