UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NPHIP/U08NzYbO0+qlyqLSRrBIOD0c4NEqYqYURtt9A=' 
WHERE 
  key_id = '5c4bd31214e8884a5b055174ae1ecdf07cdc2f72e21db07a63f9f026aefe712a' 
  AND (
    token = 'NPHIP/U08NzYbO0+qlyqLSRrBIOD0c4NEqYqYURtt9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029